package main

import "fmt"

func main1() {
	var c1 = map[string]string{"name": "han", "age": "32"}
	var c2 = map[string]string{"name": "han", "age": "32"}
	var c3 = map[string]string{"name": "han", "age": "32"}
	var customer = []map[string]string{c1, c2, c3}
	fmt.Println(customer)
	//添加客户
	var c4 = map[string]string{"name": "kai", "age": "32"}
	customer = append(customer, c4)
	//查看
	for k, v := range customer {
		fmt.Printf("ID：%-4d 客户姓名：%-4s 客户年龄：%-4s\n", k, v["name"], v["age"])
	}
	//修改[按索引]
	customer[1]["name"] = "Rain"
	customer[1]["age"] = "35"
	fmt.Println(customer)
	//删除[按索引]
	customer = append(customer[:2], customer[3:]...)
	fmt.Println(customer)
}